<?php
use Hyn\Tenancy\Models\Website;
use Hyn\Tenancy\Models\Hostname;
use Hyn\Tenancy\Contracts\Repositories\WebsiteRepository;
use Hyn\Tenancy\Repositories\HostnameRepository;

$website = new Website;
$website->uuid = 'app4_laravel_rental_test';
app(WebsiteRepository::class)->create($website);

$hostname = new Hostname;
$hostname->fqdn = 'app4.laravel-rental.test';
$hostname = app(HostnameRepository::class)->create($hostname);
app(HostnameRepository::class)->attach($hostname, $website);


/**
$sites = Website::where("id", '=', 10)->get();
$sites->each(function($site) {
    $dataBase = $site->uuid;

    app(WebsiteRepository::class)->delete($site, true);
    DB::select("drop database $dataBase");
});
 *
 * */
